package com.example.back.service.impl;

import com.example.back.mapper.UserMapper;
import com.example.back.model.User;
import com.example.back.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
* @author jialily
* @description 针对表【t_user】的数据库操作Service实现
* @createDate 2022-04-25 19:39:19
*/
@Service("userService")
@Transactional(propagation = Propagation.SUPPORTS,rollbackFor = Exception.class)
public class UserServiceImpl implements UserService{

    @Autowired
    public UserMapper userMapper;

    @Override
    public User selectForLogin(String username,String password) {
        return userMapper.selectForLogin(username,password);
    }


    @Override
    public int insertUser(String username,String password ) {
        return userMapper.insertUser(username,password);
    }


}
